﻿using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace DACU.Player
{
	internal sealed class CollectionDebugView<T>
	{
		private ICollection<T> _collection;

		[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
		public T[] Items
		{
			get
			{
				var array = new T[_collection.Count];
				_collection.CopyTo(array, 0);
				return array;
			}
		}

		public CollectionDebugView(ICollection<T> collection)
		{
			if (collection == null)
				throw new ArgumentException("collection");
			_collection = collection;
		}
	}
}